// 导入请求实例对象
import request from '@/utils/request'


// 获取首页的左侧列表数据
export const catalogList = () => {
    return request({
        url: '/api/catalog/index',
    })
}
// 获取首页的左侧列表数据
export const goodsCounts = () => {
    return request({
        url: '/api/goods/count',
    })
}
// 获取首页的右侧数据
export const getContent = (id) => {
    return request({
        url: '/api/catalog/current?id=' + id,
    })
}
// 获取商品页面
export const getGoodsCategory = (id) => {
    return request({
        url: '/api/goods/category?id=' + id,
    })
}
// 获取商品页面
export const getGoodsCategoryList = params => {
    return request({
        url: '/api/goods/list',
        params
    })
}
// 获取商品页面
export const getGoodsDetailList = id => {
    return request({
        url: '/api/goods/detail?id=' + id,
    })
}
// 获取大家一起看推荐图片数据
export const getGoodsRelatedList = id => {
    return request({
        url: '/api/goods/related?id=' + id,
    })
}
// 收藏和取消收藏
export const getAddordelete = (data) => {
    return request({
        method: 'post',
        url: '/api/collect/addordelete',
        data
    })
}
// 获取购物车数量
export const getShoppingCount = () => {
    return request({
        url: '/api/cart/goodscount',
    })
}
// 获取购物车数量
export const addShoppingCount = (data) => {
    return request({
        method: 'post',
        url: '/api/cart/add',
        data
    })
}